#include "ActionAgencyEventListen.h"
#include "agencyeventmgr.h"
#include "log.h"
#include "ActionTopic.h"



void ActionAgencyEventListen::OnAgencyEventUpdate(const topic_proto::Topic& topic)
{
    log_debug("enter");
    if (AgencyEventMgr::Instance()->Get(topic.id()) == nullptr)
    {
        return;
    }
    agency_event_proto::AgencyEvent agencyevent;
    if (!agencyevent.ParseFromArray(topic.data().data(), topic.data().size()))
    {
        log_error("data parser agency_event_proto::AgencyEvent failed, %s", topic.ShortDebugString().c_str());
        return;
    }
    log_info("agencyevent:%s", agencyevent.ShortDebugString().c_str());
    stAgencyEvent st_agencyevent;
    st_agencyevent.CopyFrom(agencyevent);
    AgencyEventMgr::Instance()->Update(std::move(st_agencyevent));
}
















